//
//  AskModel.m
//  xpkc
//
//  Created by 胡志飞 on 15/12/1.
//  Copyright © 2015年 TopSage. All rights reserved.
//

#import "AskModel.h"

#import "ReplayModel.h"

@implementation AskModel

-(instancetype)initWithDict:(NSDictionary *)dict{
    
    if (self = [super init]) {
        
        self.myaskid = [NSString stringWithFormat:@"%@",dict[@"myaskid"]];//[dict[@"myaskid"] stringValue];
        self.myasktitle = dict[@"myasktitle"];
        self.myaskcontent = dict[@"myaskcontent"];
        self.myname = dict[@"myname"];
        self.asktime = dict[@"asktime"];
        self.myavtar = dict[@"myavtar"];
        
        NSMutableArray * ReplyList = [NSMutableArray array];
        
        NSArray * array = dict[@"ReplyList"];
        for (NSDictionary * subDic in array) {
            
            ReplayModel * replyModel = [ReplayModel replayModelWithDict:subDic];
            
            [ReplyList addObject:replyModel];
            
        }
        
        self.ReplyList = ReplyList;
        
    }
    
    return self;
    
}

+(AskModel *)askModelWithDict:(NSDictionary *)dict{
    
    return [[AskModel alloc] initWithDict:dict];
    
}

@end
